package br.folhapagamento.negocio;

import java.math.BigDecimal;

public class ValeTransporte {
	private BigDecimal vrSalarioBase;
	private BigDecimal vrGastoVT;
	public ValeTransporte(BigDecimal vrSalarioBruto, BigDecimal vrGastoVT) {
		super();
		this.vrSalarioBase = vrSalarioBruto;
		this.vrGastoVT = vrGastoVT;
	}
	
	public BigDecimal valorDescontoValeTransporte(){
		BigDecimal temp = new BigDecimal(0);
		if (this.vrGastoVT.compareTo(new BigDecimal(0))>0){
			BigDecimal vPerc = this.vrSalarioBase.divide(this.vrGastoVT, 2);
			
			if (this.vrSalarioBase.compareTo(new BigDecimal(1000))>0){
				if (vPerc.compareTo(new BigDecimal(6))>0){
					temp = this.vrSalarioBase.multiply(new BigDecimal(6));
				}else{
					temp = this.vrSalarioBase.multiply(vPerc);
				}
			}
		}
		return temp;		
	}
	
	public BigDecimal getVrSalarioBruto() {
		return vrSalarioBase;
	}
	public void setVrSalarioBruto(BigDecimal vrSalarioBruto) {
		this.vrSalarioBase = vrSalarioBruto;
	}
	public BigDecimal getVrGastoVT() {
		return vrGastoVT;
	}
	public void setVrGastoVT(BigDecimal vrGastoVT) {
		this.vrGastoVT = vrGastoVT;
	}
	
}
